home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC-SIG: World of Education
/
PC-SiG's World of Education.iso
/
swmag
/
disk2368.z!p
/
TRUCK.CPP
< prev
next >
Wrap
Text File
|
1990-07-20
|
425b
|
28 lines
// Chapter 7 - Program 7
#include "truck.hpp"
void truck::init_truck(int how_many, float max_load)
{
passenger_load = how_many;
payload = max_load;
}
float truck::efficiency(void)
{
return payload / (payload + get_weight());
}
int truck::passengers(void)
{
return passenger_load;
}
// Result of execution
//
// (this file cannot be executed)